<?php

namespace app\admin\validate;

use think\Validate;

class Category extends Validate
{
    protected $rule = [
        'catename' => 'require|length:1,20|unique:category,catename,0,id|token',
        'module' => 'require',
    ];
    protected $message = [
        'catename.require' => '分类名称必须输入',
        'catename.length' => '分类名称需在1-20字符',
        'catename.unique' => '分类名称已存在',
        'module' => '分类类型必须选择',
    ];

    protected $scene = [
        'add' => ['catename', 'module'],
        'edit' => ['catename','module'],
    ];

}
